package com.hyh.eblog.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hyh.eblog.vo.PostVo;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.ServletRequestUtils;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author Summerday
 */

@Controller
public class IndexController extends BaseController{

    @RequestMapping({"", "/", "index"})
    public String index() {
        //默认值为1
        Page page = getPage();
        // 分页信息 分类 用户 置顶 精选 排序
        IPage<PostVo> results = postService.paging(page, null,null,null,null,"created");
        request.setAttribute("currId",0);
        request.setAttribute("pageData",results);
        return "index";
    }
}
